package com.shanjupay.transaction.config;

import com.shanjupay.common.cache.Cache;
import com.shanjupay.transaction.common.util.RedisCache;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.StringRedisTemplate;

/**
 * @author whb
 * @create 2021-12-08 11:15
 * @desciption redis配置
 */
@Configuration
public class RedisConfig {
    /**
     * 将Cache工具类注入到Spring容器
     * @param stringRedisTemplate
     * @return
     */
    @Bean
    public Cache cache(StringRedisTemplate stringRedisTemplate){
        return new RedisCache(stringRedisTemplate);
    }
}
